home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / ML_VECTB.ZIP / UTILS / MKFORM3.PAS < prev    next >
Pascal/Delphi Source File  |  1996-03-06  |  1KB  |  52 lines

  1. uses dosio;
  2. var
  3.   coord:array[0..60] of record x,y,z:integer end;
  4.   max:word;
  5.   f:file;
  6.  
  7. Procedure BuildForm;
  8. var a:word;
  9. begin
  10.   max:=0;
  11.   for a:=0 to 11 do begin
  12.     with coord[max] do begin
  13.       x:=trunc(80*cos(2*pi*a/12));
  14.       y:=trunc(80*sin(2*pi*a/12));
  15.       z:=0;
  16.     end;
  17.     inc(max);
  18.   end;
  19.   for a:=0 to 11 do begin
  20.     with coord[max] do begin
  21.       x:=0;
  22.       y:=trunc(80*sin(2*pi*a/12));
  23.       z:=trunc(80*cos(2*pi*a/12));
  24.     end;
  25.     inc(max);
  26.   end;
  27.   for a:=0 to 11 do begin
  28.     with coord[max] do begin
  29.       x:=trunc(80*cos(2*pi*a/12)/sqrt(2));
  30.       y:=trunc(80*sin(2*pi*a/12));
  31.       z:=trunc(80*cos(2*pi*a/12)/sqrt(2));
  32.     end;
  33.     inc(max);
  34.   end;
  35.   for a:=0 to 11 do begin
  36.     with coord[max] do begin
  37.       x:=trunc(80*cos(2*pi*a/12)/sqrt(2));
  38.       y:=trunc(80*sin(2*pi*a/12));
  39.       z:=trunc(-80*cos(2*pi*a/12)/sqrt(2));
  40.     end;
  41.     inc(max);
  42.   end;
  43. end;
  44.  
  45. begin
  46.   Writeln('Making figure ...');
  47.   openforoutput(f,'_sphere.bal','');
  48.   BuildForm;
  49.   blockwrite(f,max,2);  { Nr of points in the 3D form }
  50.   blockwrite(f,coord,max*3*2);
  51.   closefile(f,'');
  52. end.